<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "bus_account".
 *
 * @property string $account_id
 * @property string $consume_type
 * @property integer $account_type
 * @property string $account_time
 * @property double $account_money
 * @property double $change_money
 * @property string $member_id
 * @property string $shop_id
 */
class BusAccount extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'bus_account';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['consume_type', 'member_id', 'shop_id'], 'required'],
            [['account_type', 'member_id', 'shop_id'], 'integer'],
            [['account_time'], 'safe'],
            [['account_money', 'change_money'], 'number'],
            [['consume_type'], 'string', 'max' => 50]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'account_id' => 'Account ID',
            'consume_type' => '消费类型',
            'account_type' => '流水类型：1-收入，2-支出',
            'account_time' => '时间',
            'account_money' => '收入/支出的金额',
            'change_money' => '变化后的金额',
            'member_id' => '会员id',
            'shop_id' => '分店id',
        ];
    }
}
